﻿using Cofe.Core.Property;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cofe.Core.Implements
{
    /// <summary>
    /// PropertyProvider that return nothing.
    /// </summary>
    public class NullPropertyProvider : IPropertyProvider
    {
        public static NullPropertyProvider Create() { return new NullPropertyProvider(); }

        public bool IsPropertySupported(object property)
        {
            return false;
        }

        public Task<PropertyPair[]> GetPropertyAsync(object property)
        {
            throw new KeyNotFoundException();
        }

        public Task<bool> SetPropertyAsync(PropertyPair propertyPair)
        {
            return Task.Run(() => { return false; });
        }

        public Task RefreshAsync()
        {
            return Task.Run(() => { });
        }




        public bool IsPropertyReadOnly(object property)
        {
            return true;
        }

        public IPropertyDefinitions[] SupportedDefinitions
        {
            get { return new IPropertyDefinitions[] { }; }
        }


        public IPropertyDictionary PropertyDictionary { get; set; }
    }
}
